<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <style>
        #redball {
            background: red;
            width: 180px;
            height: 180px;
            border-radius: 50%;
        }
    </style>

    <div id="redball"></div>


    <script>
        document.getElementById('redball').animate([
            {
                transform: 'translateX(300px) translateY(0px)',
                offset: 0.2
            },
            {
                transform: 'translateX(300px) translateY(300px)'
            }
        ],{
            duration: 300,
            easing: 'ease',
            iterations: Infinity,
        })
    </script>

</body>

</html>